<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <select name="" id="myselect">
        <option value="">筛选</option>
        <option value="price">价格</option>
        <option value="distance">距离</option>
    </select>
    <script>
         var arr = [
            {name:"肯德基",price:100,distance:100},
            {name:"必胜客",price:200,distance:1500},
            {name:"华莱士",price:50,distance:1000}
        ]
        var myselect = document.getElementById("myselect");
        myselect.onchange = function(){
            var value = this.value;
            arr.sort(function(a,b){
                return a[value]-b[value];
            }) 
            console.log(arr);
        }
       
    </script>
</body>
</html>